package mall.service.impl;

import mall.dao.BaseDao;
import mall.service.BaseService;

public abstract class BaseServiceImpl<T, PK> implements BaseService<T, PK> {

	public abstract BaseDao<T, PK> getDao();
	
	@Override
	public boolean save(T obj) {
		this.getDao().save(obj);
		return true;
	}

	@Override
	public boolean delete(PK id) {
		this.getDao().delete(id);
		return true;
	}

	@Override
	public boolean update(T obj) {
		this.getDao().update(obj);
		return false;
	}

	@Override
	public T findById(PK id) {
		return this.getDao().findById(id);
	}
	
	@Override
	public long count() {
		return this.getDao().count();
	}
	
}
